package com.yulongtian.interviewWorks.day20221117;

import java.util.ArrayList;
import java.util.List;

/**
 * https://leetcode.cn/problems/separate-the-digits-in-an-array/
 * 可
 *
 * @author yulongTian
 * @create 2023-02-10 11:44
 */
public class Test05 {
    public static void main(String[] args) {

    }

    public static int[] separateDigits(int[] nums) {
        List<Integer> temp = new ArrayList<>();
        for (int num : nums) {
            String s = String.valueOf(num);
            for (int i = 0; i < s.length(); i++) {
                temp.add(s.charAt(i) - '0');
            }

        }
        int[] ans = new int[temp.size()];
        for (int i = 0; i < temp.size(); i++) {
            ans[i] = temp.get(i);
        }
        return ans;
    }

}
